package com.example.mybatis.service.impl;

import com.example.mybatis.mapper.PersonMapper;
import com.example.mybatis.pojo.Person;
import com.example.mybatis.service.PersonService;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("personService")
public class PersonServiceImpl  implements PersonService{


    @Autowired
    private PersonMapper personMapper;

    @Override
    public List<Person> findOne(int pageNum, int pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        return personMapper.findOne(pageNum-1,pageSize-1);
    }
}
